package competition;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

/**
 * @author ZhanBo
 * @date 2020/7/25
 */
public class MainA {

    public static void method(int [] array ,int x){
        List<Integer> list = new ArrayList<>();
        for (int i = 0 ; i<array.length ;i++){
            if (array[i] * array.length >=x){
                list.add(array[i]);
            }
        }
        System.out.println(list.size()%3);
    }

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()){
            int t = scanner.nextInt();
            for (int i = 0 ; i< t ; i++){
                int n = scanner.nextInt();
                int x = scanner.nextInt();
                int [] array = new int[n];
                for (int j = 0 ; j< n;j++){
                    array[j] = scanner.nextInt();
                }
                method(array,x);
            }
        }
    }
}
